package com.db.utils;

import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

public class StringHandler {
	public static String timeToString(Date time){
		String strTime = "";
		if(time!=null){
			SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.CHINA);
			strTime = sdf.format(time);
		}
		return strTime;
	}
	public static String formatDouble(double num){
		DecimalFormat df = new DecimalFormat("#.##");
		String formatNum = df.format(num);
		return formatNum;
	}
}
